<template>
  <h1>app</h1>
  <breadCrumb :data="data"></breadCrumb>
  <router-view></router-view>
</template>
<script setup>
import { reactive, getCurrentInstance, onMounted } from "vue"

let data = reactive([])

//1.在setup中声明如何使用eventBus

//2.reactive声明的变量重新赋值，丢失响应

//3.如何获取全局的properties属性

//4.全局创建组件&简单封装面包屑

onMounted(()=>{
  // console.log(getCurrentInstance());
  // console.log(getCurrentInstance().ctx);
  let instance = getCurrentInstance()//获取组件实例

  //获取app全局添加属性
  let $bus = instance.appContext.config.globalProperties.$bus
  $bus.$on('breadChange',input =>{
    // console.log(input);
    data.value = input
  })
})

</script>   